package com.linked.basemanage.generallog.bean.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linked.commonentity.basemanage.generallog.LinkedGeneralLog;
import com.linked.commonentity.basemanage.pass.param.GeneralLogInfo;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author :dbq
 * @date : 2023/1/16 9:36
 * @description : desc
 */
@Data
@TableName("basemanage_log_info")
public class LogInfoPO {


    /**
     *
     */
    @TableId(value = "log_id", type = IdType.ASSIGN_UUID)
    private String logId;
    /**
     *
     */
    @TableField("log_position")
    private String logPosition;
    /**
     *
     */
    @TableField("position_name")
    private String positionName;

    /**
     *
     */
    @TableField("log_order")
    private Integer logOrder;
    /**
     *
     */
    @TableField("log_project")
    private String logProject;
    /**
     *
     */
    @TableField("method_status")
    private String methodStatus;

    @TableField("method_param")
    private String methodParam;

    @TableField("method_response")
    private String methodResponse;
    /**
     *
     */
    @TableField("remarks")
    private String remarks;
    /**
     *
     */
    @TableField("trace_id")
    private String traceId;
    /**
     *
     */
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public LogInfoPO() {

    }

    public LogInfoPO(LinkedGeneralLog log) {
        this.logPosition = log.getLogPosition();
        this.positionName = log.getPositionName();
        this.logOrder = log.getLogOrder();
        this.logProject = log.getLogProject();
        this.methodStatus = log.getMethodStatus();
        this.methodParam = log.getMethodParam();
        this.methodResponse = log.getMethodResponse();
        this.remarks = log.getRemarks();
        this.traceId = log.getTraceId();

    }

    public LogInfoPO(GeneralLogInfo logInfo) {
    }

    public static LogInfoPO Builder() {
        return new LogInfoPO();
    }

    public LogInfoPO withLogPosition(String logPosition) {
        this.setLogPosition(logPosition);
        return this;
    }

    public LogInfoPO withLogOrder(Integer logOrder) {
        this.setLogOrder(logOrder);
        return this;
    }

    public LogInfoPO withLogProject(String logProject) {
        this.setLogProject(logProject);
        return this;
    }

    public LogInfoPO withMethodParam(String methodParam) {
        this.setMethodParam(methodParam);
        return this;
    }

    public LogInfoPO withRemarks(String remarks) {
        this.setRemarks(remarks);
        return this;
    }

    public LogInfoPO withTraceId(String traceId) {
        this.setTraceId(traceId);
        return this;
    }

    public LogInfoPO withPositionName(String positionName) {
        this.setPositionName(positionName);
        return this;
    }


}
